 
use "path/AMJ_wave_2.dta", clear

* Cleaning the dataset: begins here 
gen age  = 2013 - birthyr
gen     age61plus = 1 if age>60
replace age61plus = 0 if age<61
gen noHS = (educ==1)
gen HSorless = (educ<3)
gen inc3 = 1 if income  <4
replace inc3 = 2 if income >3 & income <7
replace inc3 = 3 if income >6 & income<97
gen     educ4 = .
replace educ4 = 1 if educ ==1
replace educ4 = 2 if educ ==2
replace educ4 = 3 if educ ==3 |educ==4
replace educ4 = 3 if educ ==5 |educ==6
gen     NoCollegeDegree = 1 if educ4<3
replace NoCollegeDegree = 0 if educ4>2
replace NoCollegeDegree = 1 if educ==3
 
gen     treatment_BC = .
replace treatment_BC = 1 if group==2
replace treatment_BC = 0 if group==1
gen     treatment_AD = 1-treatment_BC


tab Qd  if treatment_AD==1
tab Qd2 if treatment_AD==1

gen      QD = Qd  if treatment_AD==1 
replace  QD = Qd2 if treatment_AD==1 & QD==.

gen      QDcontrol = Qd  if treatment_AD==0 
replace  QDcontrol = Qd2 if treatment_AD==0 & QDcontrol ==.

gen     Alien = QD 
replace Alien = QDcontrol if Alien==.

order Alien QD* treatment_AD

tab QD  // This matches the result in Table 6, page 472: 2.4% of people claim that ALL are correct for the alien one

tab educ, nol
* Cleaning the dataset: ends here 


********************************************************************************
*                Results to add in the Supplementary Materials                 *
********************************************************************************

sum QDcontrol 
sum QD         
*   ttesti 1472    .8994565    .8990967    1528    .9613874    1.044122  --> p-value: 0.0412 

sum QDcontrol if educ==1
sum QD        if educ==1
*   ttesti 73    1.068493     1.18238     71    1.197183    1.358778  --> p-value: 0.2725

sum QDcontrol if educ==2 |educ==3
sum QD        if educ==2 |educ==3
*   ttesti 816    .8713235    .9130875   858    .9755245    1.106091 --> p-value: 0.0181 

		* NOT IN PAPER
		sum QDcontrol if educ==2 |educ==3 |educ==1
		sum QD        if educ==2 |educ==3 |educ==1
		* ttesti 889    .8875141      .93887 929     .992465    1.128084 --> p-value: 0.0158
		
sum QDcontrol if educ>3 & educ < 7 
sum QD        if educ>3 & educ < 7 
*   ttesti  583    .9176672    .8352706   599    .9131886    .8973072 --> p-value: 0.5354  

sum QDcontrol if income<6
sum QD        if income<6
*   ttesti  675     .842963     .923927  727    .8638239    1.026856 --> p-value: 0.3451

sum QDcontrol if income>5 & income < 97
sum QD        if income>5 & income < 97
*   ttesti  587    .9931857    .8821057  577    1.084922    1.014512  --> p-value: 0.0499 

		* NOT IN PAPER
		sum QDcontrol if income<9
		sum QD        if income<9
		*   ttesti  996    .8564257    .9080704 1025    .9297561     1.04813

		* NOT IN PAPER
		sum QDcontrol if income>8 & income < 97
		sum QD        if income>8 & income < 97
		*   ttesti  266     1.12406    .8750332 279    1.078853    .9373643    

sum QDcontrol if age > 60 
sum QD        if age > 60 
*   ttesti  361           1    .8530989 369    1.208672    1.124012 --> p-value: 0.0025 

sum QDcontrol if age <61 
sum QD        if age <61 
*   ttesti   1111    .8667867      .91153   1159    .8826575    1.005186 --> p-value:  0.3470 
********************************************************************************

 
